<%@page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<form:form modelAttribute="page" id="pagerForm" method="post"
	action="${ctx}/product/list?navtabid=${navtabid}">
    <input type="hidden" name="pageNo" value="1" />
    <input type="hidden" id="pageSize" name="pageSize" value="${page.pageSize}" />
    <input type="hidden" name="orderBy" value="${page.orderBy}" />
    <input type="hidden" name="order" value="${page.order}" />
    <input type="hidden" name="productCategory.id" value="${product.productCategory.id}" />
    <input type="hidden" name="productCategory.name" value="${product.productCategory.name}" />
    <input type="hidden" name="name" value="${product.name}" />
</form:form>
<div class="pageHeader">
	<form onsubmit="return navTabSearch(this);" action="${ctx}/product/list?navtabid=${navtabid}"
		method="post">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>产品名称：<input type="text" name="name" value="${product.name}"/>
					</td>
                    <td>
                       产品类别：
                        <input name="productCategory.name"  id="categoryname" type="text" value="${product.productCategory.name}" />
                        <input name="productCategory.id" id="test" value="" type="hidden"/>
                    </td><td> <a class="btnLook" href="${ctx}/product/lookup" rel="lookup"  lookupGroup="productCategory" title="产品类别" width="400" >查找带回</a></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li><div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">检索</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" target="dialog"  rel="productadd" href="${ctx}/product/add?navtabid=${navtabid}" rel="addproduct"  width="800" height="480"><span>添加</span></a></li>
			<li class="line">line</li>

		</ul>
	</div>
	<table class="table" width="100%" layoutH="138">
		<thead>
			<tr>
				<th width="40"><input type="checkbox" class="checkboxCtrl"
					group="c1" /></th>
				<th orderField="name" 
					class=" ${page.orderBy eq 'name' ? page.order : '' }" >name</th>
				<th orderField="number" 
					class=" ${page.orderBy eq 'number' ? page.order : '' }" >number</th>
				<th orderField="description" 
					class=" ${page.orderBy eq 'description' ? page.order : '' }" >description</th>
				<th >产品类别</th>
				<th orderField="price" 
					class=" ${page.orderBy eq 'price' ? page.order : '' }" >price</th>
				<th orderField="createTime" 
					class=" ${page.orderBy eq 'createTime' ? page.order : '' }" >createTime</th>
				<th orderField="updateTime" 
					class=" ${page.orderBy eq 'updateTime' ? page.order : '' }" >updateTime</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach var="item" items="${page.result}" varStatus="menu">
				<tr>
					<td><input type="checkbox" name="c1" value="" /></td>
				<td><c:out value='${item.name}'/></td>
				<td><c:out value='${item.number}'/></td>
				<td><c:out value='${item.description}'/></td>
				<td><c:out value='${item.productCategory.name}'/></td>
				<td><c:out value='${item.price}'/></td>
				<td>
                    <fmt:formatDate value="${item.createTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td>
                    <fmt:formatDate value="${item.updateTime}" type="both" pattern="yyyy-MM-dd HH:mm:ss"/>
                </td>
					<td>
					<a  class="btnDel" href="${ctx}/product/delete/${item.id}"
						target="ajaxTodo" title="确定要删除吗?"  >删除</a>
					<a  class="btnEdit" href="${ctx}/product/edit/${item.id}?navtabid=${navtabid}"
						target="dialog" title="修改">修改</a>
					</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
		<%@ include file="/commons/panelBar.jsp"%>
</div>
